<?php
header("Content-type: application/ms-excel");
header("Content-Disposition: attachment; filename=export_".$table.".xls");
header("Pragma: no-cache");
header("Expires: 0");
echo $head;
foreach ($database as $row){
    $myrow = "";
    foreach ($row as $key => $value) {
        $myrow .= $value."\t"; 
    }
    echo $myrow."\n";
}
?>
